package com.iwhalecloud.bss.kite.cucc.web.controller.order;

import com.iwhalecloud.bss.kite.client.dto.DataResult;
import com.iwhalecloud.bss.kite.common.constant.ErrorConsts;
import com.iwhalecloud.bss.kite.cucc.client.api.order.IDictionaryService;
import com.iwhalecloud.bss.kite.cucc.client.dto.order.DictionaryDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dictionary")
@Api(tags = { "/dictionary - 字典" })
public class DictionaryController {

    @Autowired
    private IDictionaryService dictionaryService;

    @ApiOperation(value = "字典查询", notes = "字典查询")
    @GetMapping
    public DataResult<List<DictionaryDTO>> queryDictionary(String codeType) {
        return ErrorConsts.SUCCESS.getResult(dictionaryService.listDictionary(codeType));
    }
}
